package cz.semjobKB.search.impl;

import cz.semjobKB.search.api.IRule;
import cz.semjobKB.search.api.IRulesSet;

import java.util.ArrayList;
import java.util.List;

/**
 * Class used to stored one rule set
 */
public class RulesSet implements IRulesSet {

	List<IRule> setOfRules = new ArrayList<IRule>();

    /**
     * Constructor
     * @param rules List of rules
     */
	public RulesSet(List<IRule> rules) {
		if (rules == null) {
            rules = new ArrayList<IRule>();
        }
        for (IRule rule : rules) {
			setOfRules.add(rule);
		}
	}
	
	
	public void addRule(IRule rule) {
		if (rule != null) {
			setOfRules.add((Rule)rule);
		}
	}

	
	public void removeRule(IRule rule) {
		if (rule != null) {
			setOfRules.remove((Rule)rule);
		}
	}

	
	public List<IRule> getRules() {
		return setOfRules;
	}

}
